﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Simple.Repository.Models
{
    /// <summary>
    /// 亲子任务图片表
    /// </summary>
    public class ParentChildTasksImage : BusinessFullEntityBase<Guid>
    {
        /// <summary>
        /// 文件Id
        /// </summary>
        public Guid? FiledId { get; set; }

        /// <summary>
        /// 文件名称
        /// </summary>
        public string FileName { get; set; } = "";

        /// <summary>
        /// 文件大小
        /// </summary>
        public string FileSize { get; set; } = "";

        /// <summary>
        /// 班级动态信息
        /// </summary>
        public ParentChildTasks? ParentChildTasks;

        /// <summary>
        /// 班级动态Id
        /// </summary>
        public Guid? ParentChildTasksId { get; set; } = null;

        public override void ConfigureEntity(ModelBuilder builder)
        {
            builder.Entity<ParentChildTasksImage>(entity =>
            {
                entity.HasOne(c => c.ParentChildTasks).WithMany(c => c.Images).HasForeignKey(c => c.ParentChildTasksId);
            });
        }
    }
}
